
        :root {
            --primary: #ffae00;
            --primary-dark: #ff9100;
            --bg: #ffffff;
            --bg-2: #f7f7f8;
            --text: #343541;
            --text-2: #6e6e80;
            --border: #d9d9e3;
            --shadow: rgb(238, 255, 255);
            --user-bubble: #f7f7f8;
            --ai-bubble: #ffffff;
            --error: #ef4146;
            --warning: #f5a623;
            --success: #10a37f;
            --sidebar-width: 260px;
        }

        .dark-mode {
            --primary: #10a37f;
            --primary-dark: #0e8a6d;
            /* --bg: lab(5.88% 0 0); */
             --bg: lab(4.31% 0 0);
            --bg-2: #1e1e1f;
            --text: #ffffff;
            --text-2: #d3d1d1;
            --border: #333335;
            --shadow: rgba(0, 0, 0, 0.493);
            --user-bubble: #444654;
            --ai-bubble: #343541;
            --error: #ff6b6b;
            --warning: #ffb347;
            --success: #11c547;
        }

        html {
    height: 100%;
}

body {
    background-color: var(--bg); /* background: url('sata.jpg') no-repeat center center fixed;
    /* background: url('sata.jpg') no-repeat center center fixed;
            background-size: cover;
    backdrop-filter: blur(35px);
            -webkit-backdrop-filter: blur(10px); */
    color: var(--text);
    height: 100%; /* Changed from 100vh to 100% */
    overflow: hidden;
}

#app {
    display: flex;
    height: 100%; /* Changed from 100vh to 100% */
    position: relative;
}

        * {
             margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Noto Sans Sinhala', 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
            transition: background-color 0.3s, color 0.3s, border-color 0.3s;
        }

        #app {
            display: flex;
            height: 100vh;
            position: relative;
        }

        #loadingOverlay {
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: linear-gradient(135deg, #000000 0%, #030303 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s cubic-bezier(.4,0,.2,1);
}
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.loader-spinner {
    width: 64px;
    height: 64px;
    border: 6px solid #1f1f1f;
    border-top: 6px solid #10a38f;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
    margin-bottom: 18px;
    box-shadow: 0 0 24px #10a37f44;
}
@keyframes spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}
.loader-text {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px #0002;
}

  /* Scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
        }
        
        ::-webkit-scrollbar-track {
            background: var(--darker);
        }
        
        ::-webkit-scrollbar-thumb {
            background: var(--primary);
            border-radius: 10px;
        }

/* --- Welcome Screen --- */
.welcome-screen {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    height: 100%;
    /* Initially hidden, JS will show it */
    display: none; 
}
.welcome-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}
.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.welcome-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    min-height: 1.5em; /* To prevent layout shift during typing */
    font-weight: 500;
}

        /* Sidebar Styles */
        .sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg);
    border-right: 1px solid var(--border);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    position: fixed; /* 'absolute' වෙනුවට 'fixed' භාවිතා කිරීම වඩාත් සුදුසුයි */
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%); /* පෙරනිමියෙන් තිරයෙන් පිටතට සඟවයි */
}

        .sidebar-header {
            padding: 12px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border);
        }
        /* JavaScript මගින් '.open' class එක එකතු වූ විට, ප්‍රධාන අන්තර්ගතය දකුණට තල්ලු වේ */
.sidebar.open + .main-content {
    margin-left: var(--sidebar-width);
}

/* Mobile සඳහා වන Media Query එක, දැන් main-content එකට පමණක් බලපාන ලෙස සරල කළ හැක */
@media (max-width: 768px) {
    /* Desktop වලදී sidebar එක open වූ විට main-content එක තල්ලු නොවේ නම්, මෙම රීතිය අවශ්‍ය වේ */
    .sidebar.open + .main-content {
        margin-left: 0;
    }
}

        .new-chat-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            margin: 8px;
            border-radius: 6px;
            border: 1px solid var(--border);
            background-color: transparent;
            color: var(--text);
            cursor: pointer;
            font-size: 14px;
            transition: all 0.2s;
        }

        .new-chat-btn:hover {
            background-color: var(--bg-2);
        }

        .new-chat-btn svg {
            width: 16px;
            height: 16px;
        }

        .history-container {
            flex: 1;
            overflow-y: auto;
            padding: 8px;
        }

        .history-item {
            padding: 10px 12px;
            border-radius: 6px;
            margin-bottom: 4px;
            cursor: pointer;
            font-size: 14px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: var(--text-2);
            transition: all 0.2s;
            position: relative;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .history-item:hover {
            background-color: var(--bg-2);
            color: var(--text);
        }

        .history-item.active {
            background-color: var(--bg-2);
            color: var(--text);
        }

        .history-item-delete {
            position: absolute;
            right: 8px;
            background-color: var(--bg-2);
            border-radius: 4px;
            padding: 2px;
            display: none;
        }

        .history-item:hover .history-item-delete {
            display: block;
        }

        .sidebar-footer {
            padding: 12px;
            border-top: 1px solid var(--border);
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px;
            border-radius: 6px;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .user-profile:hover {
            background-color: var(--bg-2);
        }

        .user-avatar {
            width: 28px;
            height: 28px;
            border-radius: 2px;
            background-color: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
        }

        .user-name {
            font-size: 14px;
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Main Content Styles */
        .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Sidebar එක සඟවා ඇති විට, සම්පූර්ණ ඉඩම ලබා ගනී */
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

        .chat-container {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
            display: flex;
             padding-top: 120px; /* Add space at the top, below the gradient guard */
            flex-direction: column;
            gap: 20px;
            scroll-behavior: smooth;
        }
        /* --- NEW: Chat Container Top Gradient Guard --- */
/* --- UPDATED: Chat Container Top Gradient Guard --- */
.chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px; /* Fade effect එකේ උස වැඩි කරන ලදී */
    
    /* Gradient එක, 50%ක් දක්වා පසුබිම් වර්ණයෙන් යුතුව, ඉන්පසු ක්‍රමයෙන් විනිවිද පෙනෙන ලෙස සකසා ඇත */
    background: linear-gradient(to bottom, var(--bg) 50%, transparent);
    
    z-index: 10;
    pointer-events: none; /* Scroll කිරීමට ඇති බාධාව ඉවත් කරයි */
}

 /* 2. Fix for Disorganized Message Bubbles */
        .message {
            display: flex;
            gap: 20px;
            max-width: 800px;
            margin: 0 auto;
            width: 100%;
            padding: 12px 0;
        }
        .ai-message {
    margin-right: auto; /* Bubble එක වම් පසට තල්ලු කරයි */
}

/* User's message (aligns to the right) */
.user-message {
    margin-left: auto; /* Bubble එක දකුණු පසට තල්ලු කරයි */
    flex-direction: row-reverse; /* Avatar එක සහ content එකේ පිළිවෙල මාරු කරයි */
}

.message-content {
    padding: 10px 16px;
    border-radius: 18px;
}
.ai-message .message-content {
    
    border-top-left-radius: 4px;
}

/* User's bubble color and shape */
.user-message .message-content {
    
    border-top-right-radius: 4px;
}


        .message-avatar {
            width: 36px;
            height: 36px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-weight: bold;
        }

        .user-message .message-avatar {
            background-color: var(--primary);
            color: white;
        }

        .ai-message .message-avatar {
            background-color: #5436da;
            color: white;
        }

        .message-content {
            flex: 1;
            padding-top: 4px;
        }

        .message-text {
            white-space: pre-wrap;
            line-height: 1.6;
            font-size: 16px;
        }

        .message-actions {
            display: flex;
            gap: 8px;
            margin-top: 12px;
            opacity: 0;
            transition: opacity 0.2s;
        }

        .message:hover .message-actions {
            opacity: 1;
        }

        .action-btn {
            background: none;
            border: none;
            color: var(--text-2);
            cursor: pointer;
            font-size: 13px;
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 4px 8px;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .action-btn:hover {
            background-color: var(--bg-2);
            color: var(--text);
        }

        /* Input Area Styles */
        .input-container {
            padding: 25px;
            position: relative;
        }

        .input-box {
            max-width: 800px;
            margin: 0 auto;
            width: 100%;
            border-top: 1px solid var(--border);
            position: relative;
        }

        .textarea-container {
            position: relative;
        }

        .chat-input {
            width: 100%;
            min-height: 60px;
            max-height: 200px;
            padding: 16px 52px 16px 16px;
            border-radius: 10px;
            border: 1px solid var(--border);
            background-color: var(--bg);
            color: var(--text);
            font-size: 16px;
            resize: none;
            outline: none;
            box-shadow: 0 2px 8px var(--shadow);
            line-height: 1.5;
        }

        .chat-input:focus {
            border-color: var(--primary);
            box-shadow: 3px rgba(5, 124, 31, 0.445);
        }

        .input-buttons {
            position: absolute;
            right: 12px;
            bottom: 16px;
            display: flex;
            gap: 8px;
        }

        .send-btn, .file-upload-btn, .documant-generate-btn, .ai-tool-button, .voice-btn {
            width: 32px;
            height: 32px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
        }

        .send-btn {
            background-color: var(--primary);
            color: white;
        }

        .send-btn:hover {
            background-color: var(--primary-dark);
        }

        .send-btn:disabled {
            background-color: var(--border);
            cursor: not-allowed;
            opacity: 0.7;
        }

        .file-upload-btn, .documant-generate-btn, .ai-tool-button, .voice-btn {
            background: none;
            color: var(--text-2);
        }

        .file-upload-btn:hover, .documant-generate-btn, .ai-tool-button, .voice-btn:hover {
            background-color: var(--bg-2);
            color: var(--text);
        }

        .file-input {
            display: none;
        }

        /* File Preview Styles */
        .file-preview {
            display: flex;
            gap: 8px;
            margin-top: 12px;
            flex-wrap: wrap;
        }

        .file-preview-item {
            position: relative;
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
            max-width: 100%;
            background-color: var(--bg-2);
        }

        .file-preview-icon {
            width: 24px;
            height: 24px;
            flex-shrink: 0;
        }

        .file-preview-name {
            font-size: 13px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 150px;
        }

        .file-preview-remove {
            position: absolute;
            top: -8px;
            right: -8px;
            background-color: var(--error);
            color: white;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            cursor: pointer;
            border: none;
            padding: 0;
        }

        /* Typing Indicator */
        .typing-indicator {
            display: flex;
            gap: 6px;
            padding: 12px 0;
        }

        .typing-dot {
            width: 8px;
            height: 8px;
            background-color: var(--text-2);
            border-radius: 50%;
            animation: typingAnimation 1.4s infinite ease-in-out;
        }

        .typing-dot:nth-child(1) {
            animation-delay: 0s;
        }

        .typing-dot:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-dot:nth-child(3) {
            animation-delay: 0.4s;
        }

        @keyframes typingAnimation {
            0%, 60%, 100% {
                transform: translateY(0);
                opacity: 0.6;
            }
            30% {
                transform: translateY(-5px);
                opacity: 1;
            }
        }

        /* Settings Panel */
        .settings-panel {
            position: fixed;
            right: -320px;
            top: 0;
            width: 320px;
            height: 100%;
            background-color: var(--bg);
            border-left: 1px solid var(--border);
            box-shadow: -5px 0 15px var(--shadow);
            padding: 20px;
             z-index: 2000;
            transition: right 0.3s ease;
            overflow-y: auto;
        }

        .settings-panel.open {
            right: 0;
        }

        .settings-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border);
        }

        .settings-title {
            font-size: 18px;
            font-weight: 600;
        }

        .settings-close {
            background: none;
            border: none;
            color: var(--text-2);
            cursor: pointer;
            font-size: 20px;
            padding: 4px;
        }

        .settings-section {
            margin-bottom: 24px;
        }

        .settings-section-title {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--text-2);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .settings-option {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid var(--border);
        }

        .settings-option-label {
            font-size: 14px;
        }

        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 40px;
            height: 20px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: var(--border);
            transition: .4s;
            border-radius: 20px;
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 16px;
            width: 16px;
            left: 2px;
            bottom: 2px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked + .toggle-slider {
            background-color: var(--primary);
        }

        input:checked + .toggle-slider:before {
            transform: translateX(20px);
        }

        /* Voice Listening Indicator */
        .voice-btn.listening {
            color: var(--error);
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(239, 65, 70, 0.4);
            }
            70% {
                box-shadow: 0 0 0 10px rgba(239, 65, 70, 0);
            }
            100% {
                box-shadow: 0 0 0 0 rgba(239, 65, 70, 0);
            }
        }

        /* Error Message */
       .error-message {
    /* The red background color has been removed */
    color: var(--error); /* Keeps the text red to show errors */
    font-size: 14px;
    margin-top: 5px;
    text-align: center;
    padding: 2px; /* Padding is kept to maintain spacing */
    border-radius: 4px;
    background-color: transparent; /* Makes the background invisible */
}

        /* Model Indicator */
        .model-indicator {
            position: fixed;
            bottom: 16px;
            left: 16px;
            background-color: var(--bg-2);
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 13px;
            color: var(--text-2);
            display: flex;
            align-items: center;
            gap: 6px;
            z-index: 10;
        }

        /* Sidebar Toggle Button */
       .sidebar-toggle {
    position: fixed;
    left: 16px;
    top: 16px;
    background-color: var(--bg);
    color: #ffffff;
    border: 1px solid var(--border);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex; /* 'none' වෙනුවට 'flex' යොදා, එය සෑම විටම පෙන්වයි */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 150;
}

      .sidebar-toggle:hover {
    background-color: var(--bg-2);
}

        /* Responsive Styles */
        @media (max-width: 768px) {
            .sidebar {
                transform: translateX(-100%);
                position: fixed;
                top: 0;
                left: 0;
                bottom: 0;
                z-index: 100;
            }

            .sidebar.open {
    transform: translateX(0);
}

            .main-content {
                margin-left: 0;
            }

            .sidebar-toggle {
                display: flex;
            }

            .message {
                gap: 12px;
            }

            .message-avatar {
                width: 32px;
                height: 32px;
            }

            .chat-input {
                padding: 12px 48px 12px 12px;
            }

            .input-buttons {
                right: 8px;
                bottom: 12px;
            }

            .settings-panel {
                width: 280px;
            }
        }

        /* Markdown Styling */
        .message-text pre {
            background-color: var(--bg-2);
            padding: 16px;
            border-radius: 8px;
            overflow-x: auto;
            margin: 12px 0;
            font-family: 'Courier New', Courier, monospace;
            font-size: 14px;
            line-height: 1.5;
        }

        .message-text code {
            background-color: var(--bg-2);
            padding: 2px 4px;
            border-radius: 4px;
            font-family: 'Courier New', Courier, monospace;
            font-size: 14px;
        }

        .message-text blockquote {
            border-left: 3px solid var(--primary);
            padding-left: 12px;
            margin: 12px 0;
            color: var(--text-2);
        }

        .message-text table {
            border-collapse: collapse;
            width: 100%;
            margin: 12px 0;
        }

        .message-text th, .message-text td {
            border: 1px solid var(--border);
            padding: 8px;
            text-align: left;
        }

        .message-text th {
            background-color: var(--bg-2);
        }

        .message-text ul, .message-text ol {
            margin: 12px 0;
            padding-left: 24px;
        }

        .message-text h1 {
            font-size: 24px;
            margin: 16px 0 12px 0;
        }

        .message-text h2 {
            font-size: 20px;
            margin: 14px 0 10px 0;
        }

        .message-text h3 {
            font-size: 18px;
            margin: 12px 0 8px 0;
        }

        .message-text a {
            color: var(--primary);
            text-decoration: none;
        }

        .message-text a:hover {
            text-decoration: underline;
        }

        .message-text img {
            max-width: 100%;
            height: auto;
            border-radius: 8px;
            margin: 12px 0;
        }

        /* Code Block Copy Button */
        .code-block-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: var(--bg-2);
            padding: 8px 12px;
            border-radius: 8px 8px 0 0;
            font-family: 'Segoe UI', sans-serif;
            font-size: 13px;
        }

        .code-block-copy {
            background: none;
            border: none;
            color: var(--text-2);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 13px;
        }

        .generate-document-btn {
            background-color: var(--primary);
            color: white;
            margin-left: 8px;
        }


        .code-block-copy:hover {
            color: var(--text);
        }

        .code-block-copy.copied {
            color: var(--success);
        }

        /* Document Generation Panel */
        .document-panel {
            position: absolute; /* මෙතන වෙනස් කළ යුතුයි */
            top: 50%;
            left: 50%;
            transform: translateX(-50%);
            width: 90%;
            max-width: 800px;
          
            border: 1px solid var(--border);
            border-radius: 8px 8px 0 0;
            box-shadow: 0 -5px 15px var(--shadow);
            z-index: 180;
            transition: bottom 0.3s ease;
            transition: transform 0.3s ease; /* Changed to transform */
            padding: 16px;
            max-height: 80vh;
            overflow-y: auto;
        }
        .document-panel.open {
            transform: translate(-50%, -50%); /* Center using transform */
        }

        .document-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }

        .document-title {
            font-size: 18px;
            font-weight: 600;
        }

        .document-close {
            background: none;
            border: none;
            color: var(--text-2);
            cursor: pointer;
            font-size: 20px;
        }

        .document-options {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 12px;
            margin-bottom: 16px;
        }

        .document-option {
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
        }

        .document-option:hover {
            background-color: var(--bg-2);
            border-color: var(--primary);
        }

        .document-option-icon {
            font-size: 24px;
            margin-bottom: 8px;
            color: var(--primary);
        }

        .document-option-label {
            font-size: 14px;
        }

        .document-preview {
            margin-top: 16px;
            padding: 16px;
            background-color: var(--bg-2);
            border-radius: 6px;
            max-height: 300px;
            overflow-y: auto;
        }

        .document-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            margin-top: 16px;
        }

        .document-btn {
            padding: 8px 16px;
            border-radius: 6px;
            border: none;
            cursor: pointer;
            font-size: 14px;
        }
        #onboardingModal {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.onboarding-backdrop {
  position: absolute;
  inset: 0;
  background: #18181aee;
  backdrop-filter: blur(2px);
}
.onboarding-panel {
  position: relative;
  background: #23232b;
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px #0008;
  padding: 36px 32px 28px 32px;
  min-width: 320px;
  max-width: 90vw;
  width: 400px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: onboarding-pop 0.5s cubic-bezier(.4,0,.2,1);
}
@keyframes onboarding-pop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.onboarding-step h2 {
  margin-bottom: 10px;
  font-size: 1.5rem;
  font-weight: 600;
}
.onboarding-step p {
  margin-bottom: 18px;
  color: #bdbdc7;
}
.onboarding-step label {
  display: block;
  margin-bottom: 18px;
  font-size: 1rem;
}
.onboarding-step input[type="text"],
.onboarding-step input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #18181a;
  color: #fff;
  font-size: 1rem;
  margin-top: 4px;
  margin-bottom: 2px;
  outline: none;
  transition: border-color 0.2s;
}
.onboarding-step input[type="text"]:focus,
.onboarding-step input[type="date"]:focus {
  border-color: #10a37f;
}
.onboarding-btn {
  width: 100%;
  padding: 12px 0;
  border-radius: 6px;
  border: none;
  background: #10a37f;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
}
.onboarding-btn:disabled {
  background: #444;
  cursor: not-allowed;
  opacity: 0.7;
}
.onboarding-terms {
  background: #18181a;
  border-radius: 8px;
  padding: 16px 14px;
  margin-bottom: 18px;
  font-size: 0.98rem;
}
.onboarding-terms ul {
  margin: 0 0 0 18px;
  padding: 0;
  color: #e0e0e7;
}
.onboarding-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 1rem;
}
@media (max-width: 500px) {
  .onboarding-panel { width: 98vw; min-width: unset; padding: 18px 6vw 18px 6vw; }
}
  .app-footer { 
    text-align: center; 
    padding: 8px; 
    font-size: 0.8rem; 
    color: rgb(117, 117, 117); 
    background-color: var(--surface); 
    border-top: 1px solid var(--border-color); 
}
/* --- Prism.js & Custom Code Block Styles --- */
.code-block-container {
    border-radius: 8px;
    margin: 12px 0;
    overflow: hidden; /* This is important for rounded corners on the <pre> tag */
    border: 1px solid var(--border);
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-2);
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-2);
}

.code-block-copy-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--text-2);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
}

.code-block-copy-btn:hover {
    background-color: var(--border);
    color: greenyellow;
}

.code-block-copy-btn.copied {
    background-color: var(--success);
}

/* This is the main fix for the mobile overflow issue */
.message-text pre[class*="language-"] {
    margin: 0 !important;
    border-radius: 0 0 8px 8px !important;
    font-size: 14px !important;
    white-space: pre !important;      /* Preserve code formatting */
    overflow-x: auto !important;   /* Add horizontal scrollbar ONLY to the code block */
    word-wrap: normal !important;  /* Prevent forced line breaks */
}

/* Table Formatting */
.message-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 15px;
}
.message-text th, .message-text td {
    border: 1px solid var(--border);
    padding: 10px;
    text-align: left;
}
.message-text th {
    background-color: var(--bg-2);
    font-weight: 600;
}

 /* --- NEW: Registration & Verification Styles --- */
        #registerBtn {
            position: fixed;
            top: 16px;
            right: 16px;
            z-index: 1001;
            padding: 8px 16px;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
            animation: pulse-animation 2s infinite;
        }

        #registerBtn:hover {
            background-color: var(--primary-dark);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        }
        
        @keyframes pulse-animation {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }

        .verification-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            display: none; /* Initially hidden */
            align-items: center;
            justify-content: center;
            z-index: 10000;
            backdrop-filter: blur(4px);
        }

        .verification-card {
            background-color: var(--bg);
            padding: 24px;
            border-radius: 12px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.3);
            text-align: center;
            width: 90%;
            max-width: 350px;
        }
        
        .verification-card h3 {
            margin-bottom: 16px;
        }

        #verificationCodeInput {
            width: 100%;
            padding: 12px;
            border-radius: 6px;
            border: 1px solid var(--border);
            background-color: var(--bg-2);
            color: var(--text);
            font-size: 16px;
            text-align: center;
            margin-bottom: 16px;
        }
        
        #verifyBtn {
            width: 100%;
            padding: 12px;
            border: none;
            border-radius: 6px;
            background-color: var(--primary);
            color: white;
            font-size: 16px;
            cursor: pointer;
        }
        
        #verificationSuccessMessage {
            color: var(--success);
            font-weight: bold;
            display: none; /* Initially hidden */
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 18px;
        }

        .limit-warning {
            text-align: center;
            padding: 16px;
            background-color: rgba(245, 166, 35, 0.1);
            color: var(--warning);
            border: 1px solid var(--warning);
            border-radius: 8px;
            margin: 20px;
        }
/* Tools Panel */
        .tools-panel {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 90%;
            max-width: 600px;
            background-color: var(--bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: 0 5px 15px var(--shadow);
            z-index: 300;
            padding: 20px;
            display: none;
        }

        .tools-panel.open {
            display: block;
        }

        .tools-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .tools-title {
            font-size: 20px;
            font-weight: 600;
            color: var(--primary);
        }

        .tools-close {
            background: none;
            border: none;
            color: var(--text-2);
            cursor: pointer;
            font-size: 20px;
        }

        .tools-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 16px;
            margin-bottom: 20px;
        }

        .tool-card {
            padding: 16px;
            border: 1px solid var(--border);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
            background-color: var(--bg-2);
        }

        .tool-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px var(--shadow);
            border-color: var(--primary);
        }

        .tool-icon {
            font-size: 32px;
            margin-bottom: 10px;
            color: var(--primary);
        }

        .tool-name {
            font-size: 14px;
            font-weight: 500;
        }
      /* --- Input Bar Buttons: More Options Feature --- */

/* This main container is always absolutely positioned in the corner */
.input-buttons {
    position: absolute;
    right: 12px;
    bottom: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* --- 1. DESKTOP VIEW STYLES (Default Behavior) ---
*/

/* On desktop, the '...' button is hidden */
.more-options-btn {
    display: none;
}

/* On desktop, the panel is a simple flex container, showing buttons horizontally */
.more-options-panel {
    display: flex;
    gap: 8px;
    align-items: center;
}


/* --- 2. MOBILE VIEW STYLES (Only applies when screen is 768px or less) ---
*/
@media (max-width: 768px) {
    /* On mobile, HIDE the individual buttons that are inside the panel by default */
    .more-options-panel .file-upload-btn,
    .more-options-panel .voice-btn, 
     .more-options-panel .documant-generate-btn,
    .more-options-panel .ai-tool-button,
    .more-options-panel .generate-document-btn {
        display: none;
    }

    /* On mobile, SHOW the '...' trigger button */
    .more-options-btn {
        display: flex; /* This makes it visible */
        width: 32px;
        height: 32px;
        border-radius: 6px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border: none;
        background: none;
        color: var(--text-2);
    }
    .more-options-btn:hover {
        background-color: var(--bg-2);
        color: var(--text);
    }

    /* On mobile, the panel becomes a pop-up */
    .more-options-panel {
        display: none; /* It's hidden until the '.open' class is added */
        position: absolute;
        bottom: calc(100% + 8px); /* Position it above the button group */
        right: 0;
        background-color: var(--bg);
        border: 1px solid var(--border);
        border-radius: 8px;
        box-shadow: 0 4px 12px var(--shadow);
        padding: 8px;
        flex-direction: column; /* Stack buttons vertically */
        gap: 8px;
        z-index: 10;
    }
    
    /* This class, added by JavaScript, makes the pop-up panel visible */
    .more-options-panel.open {
        display: flex;
    }

    /* When the panel is open, show the buttons inside it and add text labels */
    .more-options-panel.open .file-upload-btn,
    .more-options-panel.open .voice-btn,
     .more-options-panel.open .documant-generate-btn,
    .more-options-panel.open .ai-tool-button,
    .more-options-panel.open .generate-document-btn {
        display: flex;
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
        padding: 8px;
    }
    
    .more-options-panel.open .file-upload-btn::after { content: "Upload"; font-size: 14px; }
    .more-options-panel.open .voice-btn::after { content: "Voice"; font-size: 14px; }
     .more-options-panel.open .documant-generate-btn::after { content: "Documant"; font-size: 14px; }
      .more-options-panel.open .ai-tool-button::after { content: "Tools"; font-size: 14px; }
}
/* --- AI Response Formatting Improvements --- */
.message-text p {
    margin-block-start: 0.5em; /* абзацы අතර පරතරය අඩු කරයි */
    margin-block-end: 0.5em;
}

.message-text h1,
.message-text h2,
.message-text h3 {
    margin-block-start: 0.8em;
    margin-block-end: 0.4em;
}

.message-text ul,
.message-text ol {
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
    padding-inline-start: 25px;
}

.message-text p:first-child,
.message-text h1:first-child,
.message-text h2:first-child,
.message-text h3:first-child {
    margin-top: 0;
}
/* --- NEW: Learning Assistant & Modals Styles --- */

/* Learning Assistant Bar on top of Input */
.learning-assistant-bar {
    position: relative; 
    display: flex;
    justify-content: center; 
    margin-bottom: -1px;
    z-index: 10;
}
.learning-assistant-bar > span {
    display: inline-block;
    padding: 6px 16px;
    background-color: var(--bg-2);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    transition: all 0.2s;
}
.learning-assistant-bar > span:hover {
    color: var(--primary);
    background-color: var(--bg);
}

/* Options Panel Pop-up */
.learning-options-panel {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 -4px 12px var(--shadow);
    padding: 8px;
    display: none; /* Initially hidden */
    gap: 8px;
}
.learning-options-panel.open {
    display: flex;
}
.learning-options-panel button {
    background: none;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
}
.learning-options-panel button:hover {
    background-color: var(--bg-2);
    border-color: var(--primary);
}

/* Q&A Teacher Card in Chat */
.qa-teacher-card {
    background-color: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin: 16px auto;
    max-width: 700px;
}
.qa-teacher-card h2 { margin-top: 0; }
.qa-teacher-card .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}
.qa-teacher-card .form-group { display: flex; flex-direction: column; }
.qa-teacher-card label { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.qa-teacher-card input, .qa-teacher-card select, .qa-teacher-card textarea {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--text);
}
.qa-teacher-card textarea { resize: vertical; min-height: 80px; }
.qa-teacher-card .form-group.full-width { grid-column: 1 / -1; }
.qa-teacher-card .toggle-group { display: flex; align-items: center; gap: 8px; }
.qa-teacher-card button {
    width: 100%; padding: 12px; border: none; border-radius: 6px;
    background-color: var(--primary); color: white; font-size: 16px; cursor: pointer;
}

/* General Fullscreen Modal Styles */
.fullscreen-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7); backdrop-filter: blur(5px);
    display: none; align-items: center; justify-content: center; z-index: 10001;
}
.fullscreen-modal.open { display: flex; }
.modal-content {
    background-color: var(--bg); border-radius: 12px; width: 90%; max-width: 600px;
    max-height: 90vh; display: flex; flex-direction: column;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; border-bottom: 1px solid var(--border);
}
.modal-close-btn { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--text-2); }
.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex-grow: 1; /* <-- මෙම පේළිය අලුතින් එක් කරන්න */
    min-height: 0;   /* <-- මෙම පේළියද අලුතින් එක් කරන්න */
}
.modal-file-input { display: none; }
.modal-file-label {
    display: block; text-align: center; padding: 12px; border-radius: 6px;
    border: 2px dashed var(--border); cursor: pointer; margin-bottom: 16px;
}
.image-preview { max-width: 100%; max-height: 200px; border-radius: 8px; display: none; margin: 0 auto 16px auto; }
.modal-action-btn { width: 100%; padding: 12px; border: none; border-radius: 6px; background-color: var(--primary); color: white; font-size: 16px; cursor: pointer; }
.modal-action-btn:disabled { background-color: var(--border); cursor: not-allowed; }
.modal-result-area { margin-top: 20px; background-color: var(--bg-2); padding: 16px; border-radius: 8px; }

/* Live Exam Styles */
.exam-modal-content { max-width: 800px; }
.exam-question { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.exam-question.locked { opacity: 0.6; pointer-events: none; }
.exam-question p { font-weight: bold; margin-bottom: 12px; }
.exam-options { display: flex; flex-direction: column; gap: 8px; }
.exam-option { padding: 10px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.exam-option:hover { background-color: var(--bg-2); }
.exam-option.selected { background-color: var(--primary); color: white; }
.exam-result-review .exam-option.correct { border-color: var(--success); background-color: #10a37f20; }
.exam-result-review .exam-option.incorrect { border-color: var(--error); background-color: #ef414620; }
#examResultContainer h3 { text-align: center; }
#examResultContainer .score { font-size: 48px; font-weight: bold; text-align: center; color: var(--primary); margin: 16px 0; }
#examResultContainer .stats { display: flex; justify-content: space-around; text-align: center; }
.stat-item span:first-child { display: block; font-size: 24px; font-weight: bold; }
.stat-item a { cursor: pointer; color: var(--error); text-decoration: underline; }

/* --- NEW: General Message Popup Styles --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(12, 12, 12, 0.226);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002; /* Should be on top of everything */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.open {
    opacity: 1;
}

.popup-card {
    background-color:  rgba(6, 68, 32, 0.6);
    color: var(--text);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    width: 90%;
    max-width: 450px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.popup-overlay.open .popup-card {
    transform: scale(1);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.popup-header h3 {
    margin: 0;
    color: #03ff4e;
    font-size: 18px;
    font-weight: 600;
}

.popup-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: var(--text-2);
    cursor: pointer;
    line-height: 1;
}

.popup-body {
    padding: 24px;
    line-height: 1.6;
    font-size: 15px;
}

.popup-body p {
    margin: 0;
}
/* --- NEW: Welcome Screen & Explain Cards Styles --- */
.welcome-screen-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: auto; /* This centers it vertically and horizontally in the flex container */
    padding: 20px;
    height: 100%;
}

.welcome-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    border-radius: 50%;
    background-color: var(--bg-2);
}

.welcome-headline {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.welcome-greeting {
    font-size: 1.2rem;
    color: var(--text-2);
    margin-bottom: 32px;
}

.welcome-greeting .user-name-highlight {
    color: #007bff; /* නිල් පැහැය */
    font-weight: 600;
}

.dark-mode .welcome-greeting .user-name-highlight {
    color: #4da3ff; /* Dark mode සඳහා ගැළපෙන නිල් පැහැයක් */
}

.explain-cards-container {
    display: flex;
    gap: 16px;
    width: 100%;
    max-width: 800px;
}

/* --- කාඩ් එක වටා දිලිසෙන ඉර ගමන් කිරීමේ සජීවීකරණය (අවසාන විසඳුම) --- */

/* 1. ප්‍රධාන කාඩ් එකේ මූලික සැකසුම */
.chat-explain-card {
    flex: 1;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 0;
    overflow: hidden;
}

/* 2. කාඩ් එකේ පසුබිම ලෙස ක්‍රියා කරන ::after pseudo-element එක */
.chat-explain-card::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 1px;
    background-color: var(--bg);
    border-radius: 11px;
}

/* 3. චලනය වන දිලිසෙන ඉර නිර්මාණය කරන ::before pseudo-element එක */
.chat-explain-card::before {
    content: '';
    position: absolute;
    z-index: -3;
    inset: 0;
     border: 8px solid var(--border);
    border-radius: 20px;
    background: conic-gradient(
        from 180deg at 50% 50%,
        transparent 80%,
        var(--primary) 95%,
        transparent 100%
    );
    
    /* සජීවීකරණය යෙදීම (මෙය අත්‍යවශ්‍යයි) */
    animation: rotate-border 4s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease-in;
}
.chat-explain-card::after {
    content: '';
    position: absolute;
    z-index: -2;
    
    /* ඝනකම 3px දක්වා වැඩි කිරීම */
    inset: 2px; 
    
    background-color: var(--bg);
    
    /* අරය 12px - 3px = 9px ලෙස සැකසීම */
    border-radius: 4px; 
}

/* 4. hover වූ විට, දිලිසෙන ඉර පෙන්වීම */
.chat-explain-card:hover::before {
    opacity: 1;
}

/* 5. hover වූ විට, card එක මඳක් ඉහළට එසවීම */
.chat-explain-card:hover {
    transform: translateY(-4px);
   
}

/* 6. සජීවීකරණය සඳහා වන @keyframes රීතිය (මෙය නොමැතිව ඉර ගමන් නොකරයි) */
@keyframes rotate-border {
    from {
        transform: rotate(50deg);
    }
    to {
        transform: rotate(500deg);
    }
}

.chat-explain-card h4 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 6px;
}

.chat-explain-card p {
    font-size: 0.9rem;
    color: var(--text-2);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .explain-cards-container {
        flex-direction: column;
    }
    .welcome-headline {
        font-size: 1.8rem;
    }
}

/* --- NEW: Welcome Screen Additions & Studio Popup --- */

/* Subtitle under the main greeting */
.welcome-subtitle {
    font-size: 0.95rem;
    color: var(--text-2);
    max-width: 550px;
    line-height: 1.5;
    margin: -24px 0 32px 0;
}

/* Divider and Visit Studio Button */
.divider-container {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 800px;
    margin-top: 24px;
}
.welcome-divider {
    flex-grow: 1;
    border: none;
    border-top: 1px solid var(--border);
}
.visit-studio-btn {
    background-color: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
}
.visit-studio-btn:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* --- UPDATED: JGS AI Studio Popover Styles --- */
/* Parent container needs to be relative for positioning */
.divider-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 800px;
    margin-top: 24px;
}

/* The popover itself */
.studio-popover {
    position: absolute;
    bottom: calc(100% + 12px); /* Position it 12px above the button container */
    left: 50%;
    
    /* Animation: Initial state (hidden) */
    transform: translate(-50%, 10px); /* Start slightly lower */
    opacity: 0;
    pointer-events: none; /* Can't be clicked when hidden */
    transition: opacity 0.3s ease, transform 0.3s ease;
    
    width: 90vw;
    max-width: 420px;
    background-color: var(--bg);
    border-radius: 12px;
    box-shadow: 0 5px 20px var(--shadow);
    z-index: 20;
    padding: 0; /* Padding will be on the inner content */
}

/* The tail/arrow of the popover */
.studio-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: var(--bg) transparent transparent transparent;
}

/* Animation: Open state */
.studio-popover.open {
    transform: translate(-50%, 0); /* Move to final position */
    opacity: 1;
    pointer-events: auto; /* Allow clicks when open */
}

/* Inner content styling */
.studio-popup-content {
    display: flex;
    align-items: center;
    gap: 20px;
}
.studio-popup-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.studio-popup-text {
    padding: 16px;
    padding-left: 0;
}
.studio-popup-text h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
}
.studio-popup-text p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: var(--text-2);
}
.studio-try-now-btn {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}
.studio-try-now-btn:hover {
    background-color: var(--primary-dark);
}
.tool-icon {
      width: 40px;
      height: 40px;
      background-color: rgba(217, 120, 95, 0.1);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 15px;
      color: var(--accent-color);
      font-size: 18px;
    }

/* General Modal Styles (if you don't have them) */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; display: flex; }
.modal {
    background-color: var(--darker-bg, #111); border-radius: 12px;
    width: 90%; max-width: 500px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transform: scale(0.95); transition: transform 0.3s ease;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { padding: 20px; border-bottom: 1px solid var(--border-color, #333); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 20px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 24px; color: var(--text-secondary, #999); cursor: pointer; }
.modal-body { padding: 20px; }

/* Profile Modal Specific Styles */
.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.profile-avatar {
    width: 100px; height: 100px; border-radius: 50%;
    background-color: var(--card-bg, #222);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px; border: 3px solid var(--accent-color, #d9785f);
    font-size: 48px; color: var(--accent-color, #d9785f);
}
.profile-name { font-size: 22px; font-weight: 600; margin-bottom: 5px; }
.profile-birthday { font-size: 14px; color: var(--text-secondary, #999); margin-bottom: 20px; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; width: 100%; margin-bottom: 20px; }
.stat-card { background-color: var(--card-bg, #222); border-radius: 8px; padding: 15px; }
.stat-value { font-size: 24px; font-weight: 700; margin-bottom: 5px; color: var(--accent-color, #d9785f); }
.stat-label { font-size: 12px; color: var(--text-secondary, #999); text-transform: uppercase; letter-spacing: 1px; }
.status-indicator { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; background-color: rgba(244, 67, 54, 0.1); border-radius: 20px; }
.status-dot { width: 8px; height: 8px; background-color: var(--error-color, #F44336); border-radius: 50%; }
.status-text { font-size: 13px; color: var(--error-color, #F44336); }
.status-indicator.verified { background-color: rgba(76, 175, 80, 0.1); }
.status-indicator.verified .status-dot { background-color: var(--success-color, #4CAF50); }
.status-indicator.verified .status-text { color: var(--success-color, #4CAF50); }

